package com.runa.protocol.dto;

import com.runa.protocol.enums.S7Enum;

public class S7DataItem {

    private S7Enum.ReturnCode returnCode;

    private S7Enum.TransportSize transportSize;

    private int bitAmount;

    private byte[] data;

    public S7DataItem(S7Enum.ReturnCode returnCode) {
        this.returnCode = returnCode;
    }

    public S7DataItem(S7Enum.ReturnCode returnCode, S7Enum.TransportSize transportSize, int bitAmount) {
        this.returnCode = returnCode;
        this.transportSize = transportSize;
        this.bitAmount = bitAmount;
    }

    public S7Enum.ReturnCode getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(S7Enum.ReturnCode returnCode) {
        this.returnCode = returnCode;
    }

    public S7Enum.TransportSize getTransportSize() {
        return transportSize;
    }

    public void setTransportSize(S7Enum.TransportSize transportSize) {
        this.transportSize = transportSize;
    }

    public int getBitAmount() {
        return bitAmount;
    }

    public void setBitAmount(int bitAmount) {
        this.bitAmount = bitAmount;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public int getByteSize() {
        return 4 + data.length;
    }
}
